package com.example.stock.controller;

import com.example.stock.service.StockCorrService;
import com.example.stock.util.Result;
import com.example.stock.util.ResultGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin(origins = "*")
@RequestMapping("corr")
@RestController
public class StockCorrController {

    @Autowired
    StockCorrService stockCorrService;

    @GetMapping("{stock}")
    Result stock(@PathVariable String stock) {
        return ResultGenerator.genSuccessResult(stockCorrService.getStockCorrByStock(stock));
    }
}
